/*
 * @Author: yushuang
 * @Date: 2024-11-13 10:47:57
 * @LastEditors: yushuang
 * @LastEditTime: 2024-11-27 15:01:05
 * @Description:
 */
import { createApp } from 'vue';
import App from './App.vue';
import '@/assets/iconfont/iconfont.css';
import router from '@/router';
import directives from '@/directive';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
// element dark css
import 'element-plus/theme-chalk/dark/css-vars.css';
// custom element dark css
import '@/styles/theme/element-dark.scss';
// reset style sheet
import '@/styles/index.scss';
// 因element-plus默认是英文，我们指定一下默认中文
import locale from 'element-plus/es/locale/lang/zh-cn';
// 图标并进行全局注册
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import MarqueeText from 'vue-marquee-text-component';
// vue i18n
import I18n from '@/languages/index';
import pinia from '@/store';

const instance = createApp(App);
instance.use(router);
instance.use(pinia);
instance.use(I18n);
instance.use(directives);
// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  instance.component(key, component);
}
// 注册ElementPlus
instance.use(ElementPlus, {
  locale // 语言设置
  // size: Cookies.get('size') || 'medium' // 尺寸设置
});
// Vue 文本字幕组件全局组件祖册
instance.component('MarqueeText', MarqueeText);
instance?.mount('#app');
